package gossbs;

public class J05NestedLoop {
	public static void main(String[]args){
		//중첩 반복문
		//for문 안에 또 다른 for문을 작성하거나
		//while문 안에 또 다른 while문을 작성하거나
		//do-while문 안에 또 다른 do-while문을 작성하는 것을 의미
		
		//구구단
		// 2 * 1 = 2
		
		/*for(int a = 1 ; a <= 9; ++a){
			System.out.println("2 * "  + a+  "=" +2*a);
		}
		for(int j = 1 ; j <= 9; ++j){
			System.out.println("5 * "  + j +  "=" +5*j);	
		}
		for(int k = 1 ; k <= 9; ++k){
			System.out.println("9 * "  + k +  "=" +9*k);
		}
		*/
/*	for(int j = 1 ; j <= 9 ; ++j){
		for(int i = 2 ; i<=9; ++i){
			System.out.print("\t");
			System.out.print(i+ "x" + j + "=" +( i*j));
			
		}
		System.out.println("\n"); //줄바꿈
*/	
		//while 십구단
		//do-while 십구단
		/*int i = 2;
		while(i <= 19){
			int j = 1;
			while(j<=9){
			System.out.print("\t");
			System.out.print(i+ "x" + j + "=" +( i*j));
			j++;			
			}
			i++;
			System.out.println("\n");
			}*/
	
/*		int i=2;
		do{
			int j=1;
			do{
			System.out.print("\t");
			System.out.print(i+ "x" + j + "=" +( i*j));
			++j;
			}while(j<=9);
			++i;
			System.out.println("\n");
		}while(i<=19);*/
		
		int i=1;
		int j=1;
		while(j <= 19){
			while(i <= 19){
				System.out.print("\t");
				System.out.print(i+ "x"+  j+ "="+ (i*j));
				++i;
		}
			++j;
			i =1;
		}
	}
		
		
		
		
		
		
		
		
		
		
		
		
		
}

